package com.example.boot.util;

import com.example.boot.ResultEnum.ResultEnum;

public class ResultUtil {

	public static ResultData success(Object object) {
		ResultData data = new ResultData<>();
		data.setCode(ResultEnum.SUCCESS.getCode());
		data.setMsg(ResultEnum.SUCCESS.getMsg());
		data.setData(object);
		return data;
	}

	public static ResultData success() {
		return success(null);
	}

	public static ResultData error(Integer code, String msg) {
		ResultData data = new ResultData<>();
		data.setCode(code);
		data.setMsg(msg);
		return data;
	}

}
